package com.projects.android.adapters;

import android.view.View;
import android.widget.TextView;

import com.projects.android.R;
import com.projects.android.utils.Utils;

public class ManageOrdersViewHolder {
	private View mRow;
	private TextView IDOrder = null;
	private TextView OrderDate = null;
	private TextView Restaurant = null;

	public ManageOrdersViewHolder(View row) {
		mRow = row;
	}

	public TextView getIDOrder() {
		if (null == IDOrder) {
			IDOrder = (TextView) mRow.findViewById(R.id.lblIDOrder);
			IDOrder.getLayoutParams().width = 20;
		}
		return IDOrder;
	}
	
	public TextView getRestaurant() {
		if (null == Restaurant) {
			Restaurant = (TextView) mRow.findViewById(R.id.lblOrderRestaurant);
			Restaurant.getLayoutParams().width = Utils.SCREEN_WIDTH  / 2 - 30;
		}
		return Restaurant;
	}
	
	public TextView getOrderDate() {
		if (null == OrderDate) {
			OrderDate = (TextView) mRow.findViewById(R.id.lblOrderDate);
			OrderDate.getLayoutParams().width = Utils.SCREEN_WIDTH / 2 + 10;
		}
		return OrderDate;
	}
}
